﻿using System.Drawing.Printing;
using System.Windows.Forms;

namespace Vendas.Dialogs
{
    public partial class FormImpressoraComanda : Form
    {
        public FormImpressoraComanda()
        {
            InitializeComponent();
            foreach (var printer in PrinterSettings.InstalledPrinters)
            {
                cboImpressora.Properties.Items.Add(printer);
            }
        }

        private void cboImpressora_MouseDown(object sender, MouseEventArgs e)
        {
            
        }

        private void cboImpressora_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyData == Keys.Enter)
            {
                Close();
            }
        }

        public string Impressora
        {
            get
            {
                if (cboImpressora.SelectedItem == null)
                {
                    return "";
                }
                return cboImpressora.SelectedItem.ToString();
            }
        }
    }
}
